<?
//------ BEGIN PROGRAM ------//

include"hubung.php";

// periksan input data //
	if($code==""||$name==""||$address==""||$no_phone==""){
	header ('Location: ../main');
	exit;
	}

// lakukan pencarian!!! //
	$baca=mysql_query("select * from teller where code ='$code'");
	$cari=mysql_num_rows($baca);

// algoritm laksanakan //
	if($cari==0){
	/* data baru */
	$new=mysql_query("insert into teller (code,name,address,no_phone)values('$code','$name','$address','$no_phone')");
	}
	else{
	/* updt data */
	$upd=mysql_query("update teller set name='$name', address='$address', no_phone='$no_phone' where code='$code'");
	}

// kembalikan kemenu!! //
	header ('Location: ../main');

//------ ENDING PROGRAM ------//
?>